package com.hx.tx.springboot.controller;

import com.hx.tx.springboot.model.User;
import com.hx.tx.springboot.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author jxlgcmh
 * @date 2020-05-17 23:39
 * @description
 */
@RestController
public class UserController {

    @Autowired
    private UserService userService;

    @RequestMapping("user/modify")
    public String modifyUser(){
        User user = new User();
        user.setId(1);
        user.setName("lucy");
        try {
            userService.modifyUser(user);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "success";
    }

}
